import { createRouter, createWebHashHistory } from 'vue-router'
import Home from '../views/Home.vue'
import A from '../views/A.vue'
import B from '../views/B.vue'

const routes = [
  {
    path:'/',
    redirect: '/home',  // 重定向:重新指向其它path,会改变网址
  },
  {
    path: '/home',
    component: Home
  },
  {
    path:'/shopA',
    component: A
  },
  {
    path:'/shopB/:id',
    component: B
  }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
